using System.Collections;
using System.Collections.Generic;
using Cinemachine;
using UnityEngine;
using UnityEngine.Tilemaps;

public class Grid : MonoBehaviour
{
    private Tilemap floor;
    private Tilemap wall;

    // Start is called before the first frame update
    void Awake()
    {
        floor = transform.Find("Floor").GetComponent<Tilemap>();
        wall = transform.Find("Wall").GetComponent<Tilemap>();
        RandomDungeonUtils.Instance.CreateDungeon(GameResources.Instance.dungeonDetailSO, floor,wall);
        GameManager.Instance.InitGame();
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.R))
        {
            floor.ClearAllTiles();
            RandomDungeonUtils.Instance.CreateDungeon(GameResources.Instance.dungeonDetailSO, floor,wall);
        }
    }
}